package com.house.java.util;

import com.house.java.model.HouseSurround;

public class HouseSurroundUtil {

	public void setHouseSurround(HouseSurround surround,String fieldName,String fieldValue){
		if(StringUtils.hasLength(fieldValue) && StringUtils.hasLength(fieldName)){
			
		}
	}
	
	/**
	 * 根据属性名设置SecondHouse的属性值
	 * @param house
	 */
	public void setFieldForHouseSurround(HouseSurround surround,String fieldName,String fieldValue){
		if("kindergarten".equals(fieldName)){
			surround.setKindergarten(fieldValue);
		}else if ("id".equals(fieldName)) {
			surround.setId(Long.valueOf(fieldValue));
		}else if ("primarySchool".equals(fieldName)) {
			surround.setPrimarySchool(fieldValue);
		}else if ("middleSchool".equals(fieldName)) {
			surround.setMiddleSchool(fieldValue);
		}else if ("highMiddleSchool".equals(fieldName)) {
			surround.setHighMiddleSchool(fieldValue);
		}else if ("university".equals(fieldName)) {
			surround.setUniversity(fieldValue);
		}else if ("hospital".equals(fieldName)) {
			surround.setHospital(fieldValue);
		}else if ("bank".equals(fieldName)) {
			surround.setBank(fieldValue);
		}else if ("plaza".equals(fieldName)) {
			surround.setPlaza(fieldValue);
		}else if ("park".equals(fieldName)) {
			surround.setPark(fieldValue);
		}
	}
}
